package com.heima.search.repository;

import com.heima.search.entity.ApAssociateWords;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

public interface ApAssociateWordsRepository extends MongoRepository<ApAssociateWords, String> {


    /**
     * 根据联想词查询前五条记录:包含关键字；根据创建时间降序排序
     * @param keyword
     * @return
     */
    List<ApAssociateWords> findTop5ByAssociateWordsContainingOrderByCreatedTimeDesc(String keyword);
}